<?php echo $this->render('layouts/__header.phtml'); ?>
<?php echo $this->render('layouts/__nav.phtml'); ?>
	<h1>My <?php if($this->listType!="finished"):?>under work <?php else:?>finished <?php endif;?>tasks</h1>
	<form action="<?php echo $this->baseUrl() ?>/user/messages" method="post" id="form1" name="form1">
	<input type="hidden" id="hidaction" name="hidaction" value=""/>
	<input type="hidden" id="hidid" name="hidid" value=""/>
	<div style="width:100%;text-align:right;margin:10px 0;"><?php if($this->listType=="finished"):?><a href="/user/tasks/">My under work tasks</a><?php else: ?><a href="/user/tasks/type/finished">My finished tasks</a><?php endif;?></div>
	<div id="tasklistbox">	
		<table class="normaltable" style="clear:both;">
		<tr class="tit">
			<td>ID</td>			
			<td width="400">Title</td>			
			<td>Start Date</td>
			<td>Duration</td>
		</tr>
		<?php if ($this->taskCount == 0): ?>
		<tr><td colspan="5" style="color:#cc0000;height:50px;text-align:center"><b>Empty task list ...</b></td></tr>
		<?php else: ?>
		<?php foreach ($this->taskList as $task){?>
		<tr>
			<td><?php echo $task['id']?></td>			
			<td><a href="/task/detail/id/<?php echo $task['id']?>/"><?php echo $task['title']?></a></td>
			<td><?php echo $task['date_start']?></td>
			<td><?php echo $task['duration']?></td>			
		</tr>
		<?php }?>
		<?php endif; ?>
		</table>
	</div>
	<div class="listbottom">
		<div class="pagelist" <?php if (!$this->pager) {echo 'style="display:none"';} ?> ><?php echo $this->pager['prevStr'];?>&nbsp;<?php echo $this->pager['pageStr'];?>&nbsp;<?php echo $this->pager['nextStr'];?>&nbsp;<input id="pageto" type="text" /><a id="gopagebtn" href="javascript:;">Go</a></div>
	</div>
	</form>
		
	<div id="loadingbox" style="display:none;padding:2px 0px 0px 8px;width:125px;height:20px;text-align:center;position:absolute;top:0px;right:0px;background:#CC0000;color:#fff"><b>Loading ...</b></div>

<script type="text/javascript" src="<?php echo $this->baseUrl() ?>/js/mootools.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl() ?>/js/task.js"></script>
<?php echo $this->render('layouts/__footer.phtml'); ?>